import { useEffect } from 'react'
import { useSelector, useDispatch } from 'react-redux'
import { fetchAsyncList } from './store/modules/asyncListStore'

const App = () => {

  const { list } = useSelector(state => state.asyncListReducer)
  const dispatch = useDispatch()

  useEffect(() => {
    dispatch(fetchAsyncList())
  }, [])

  return (
    <div>
      {list.map(item => <p key={item}>{item}</p>)}
    </div>
  )
};

export default App;
